package org.example.mapper;

import org.apache.ibatis.annotations.*;
import org.example.pojo.OperationLog;
import org.example.pojo.User;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserMapper {


    User selectUserInfo(User user);

    void insertUser(User user);

    //更细你登录时间
    @Update("update user_tb set update_time = #{date} where id = #{id}")
    void updateLoginTime(@Param("id") Integer id, @Param("date") Date date);

    @Insert("insert into user_operation_log (user_id,operation_user_id,create_time,operation_type,text) values (#{userId},#{operationUserId},#{createTime},#{operationType},#{text})")
    void insertUserProofStart(OperationLog log);

    @Update("update user_tb set password = #{newPassword},is_def_password=#{nodef} where id = #{id}")
    void updatePassword(@Param("id") Integer id, @Param("newPassword") String newPassword, @Param("nodef") String nodef);

    @Select("select * from user_tb")
    List<User> adminlist();
//根据id查询西湖局
    @Select("select * from user_tb where id = #{id}")
    User queryUserByUserId(Integer id);
    //更新用户标记项目
    @Update("update user_tb set marked_projects = #{markProject} where id = #{id}")
    void updateUserMarkProject(@Param("id") Integer id, @Param("markProject") String markProject);
}
